package fox.framework.rpc.message;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @author cuichao
 * @Description: MappedRpcHeader
 * @Date: create in 2021/2/15 22:10
 */
public class MappedRpcHeader implements RpcHeader {
    private Map<String,String> headers = new HashMap<>();

    @Override
    public String getHeader(String name) {
        return headers.getOrDefault(name,null);
    }

    @Override
    public void setHeader(String name, String value) {
        headers.put(name,value);
    }

    @Override
    public Collection<String> getHeaderNames() {
        return headers.keySet();
    }
}
